<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>03_BOM操作</title>
    </head>
    <body>
        <button onclick="alert('警告框')">弹出警告框</button>
        <button onclick="confirm('确认框')">您确认要删除吗</button>
        <button onclick="prompt('请输入会员卡号')">弹出输入框</button>

        <script>
            //将参数转为整数
            console.log(parseInt(6.6));//6
            console.log(parseInt(6.1));//6
            console.log(parseInt(6));//6
            console.log(parseInt('hhh'));//NaN
            console.log(parseInt('12hh34h56'));//12

            //将参数转为小数
            console.log(parseFloat(5.6));//5.6
            console.log(parseFloat(5));//5
            console.log(parseFloat('hhh'));//NaN
            console.log(parseFloat('3.4hh3.3h3.1'));//3.4

            //判断参数是否为非数字,数字得到false,非数字得到true
            console.log(isNaN('hhh'));//true
            console.log(isNaN(7));//false
            console.log(isNaN(7.7));//false
        </script>
    </body>
</html>